import React, { PureComponent } from "react";
import { connect } from "dva";
import { Col, Row} from "antd";
import DocumentTree from "./components/DocTree";
import DocTable from "./components/DocTable";
import style from "./style.less";




class DocAssets extends PureComponent {

    render() {

        return (
            <div>
                <Row type='flex' style={{ width: 'auto' }} justify="center">
                    <Col span={5} className={style.treeWrapper}>
                        <DocumentTree />
                    </Col>
                    <Col span={18} style={{ padding: '15px' }}>
                        <DocTable/>
                    </Col>
                </Row>
            </div>
        )
    }

    componentDidMount() {
        this.props.queryTreeData()
    }

}

const mapState = (state) => {
    return {
        
    }
}

const mapDispatch = (dispatch) => {
    return {
        queryTreeData() {
            dispatch({
                type: 'docAssets/queryTreeData'
            })
        }
    }
}


export default connect(mapState,mapDispatch)(DocAssets);